#ifndef HTTPPOSTSTREAM_HPP
#define HTTPPOSTSTREAM_HPP

#include <QFile>
#include <QIODevice>

class HttpPostStream : public QIODevice
{
    Q_OBJECT

public:
    HttpPostStream(const QString & uploadFile, const QByteArray & _startRequest, const QByteArray & _endRequest, QObject * parent = 0);

    ~HttpPostStream();

    bool openFile();
    qint64 readData(char * data, qint64 maxLength);
    qint64 writeData(const char *, qint64);
    qint64 size() const;

private:
    QFile * file;
    QByteArray * startRequest;
    QByteArray * endRequest;
    qint64 position;
    qint64 sizePart() const;

};

#endif // HTTPPOSTSTREAM_HPP
